#ifndef BEGINCONNINSDESTHANDLER_H
#define BEGINCONNINSDESTHANDLER_H

#include "BeginConnDestHandlerBase.h"
#include "InsteadHttpUrl.h"

class BeginConnInsDestHandler:public BeginConnDestHandlerBase
{
public:
	BeginConnInsDestHandler(const InsteadHttpUrl &url):BeginConnDestHandlerBase(),m_insteadUrl(url){}

	~BeginConnInsDestHandler(){}

protected:
	virtual void CreateSocketPostProcess(ClientContext&,OVERLAPPED*,SOCKET sock);

	virtual const std::string& DestinationServerName(ClientContext&);

	virtual const unsigned short DestinationServerPort(ClientContext&);

	virtual ITransHandler* GetNextHandler();

	virtual ExecuteResultCode OnExecuteError(ClientContext&,OVERLAPPED*,ExecuteResultCode);

	virtual ExecuteResultCode OnConnected(ClientContext &client,OVERLAPPED *ovl);

	InsteadHttpUrl m_insteadUrl;

private:
	static log4cplus::Logger log;
};

#endif